<%@page import="java.util.Map"%>
<%@page import="org.proddevplm.constants.*"%>
<%@page import="org.proddevplm.business.user.constants.UserMgmtConstants"%>

<script>
	$(function(){
		$("#login").button();
	});
</script>

<div align="center" style="margin-top:150px">
	
	<div class="containerBig" style="text-align:center; width:400px; font-family:verdana;">

		<div class="pageTitle" style="height:40px; padding-top:5%;">
			<div style="color:darkblue;font-size:large;">
				Welcome to @PLM
			</div>
		</div>
		<div style="clear:both"></div>

		<form method="post" action="/proddev/controller" >
			
			<input type = "hidden" name = "<%=ControllerConstants.MANAGER_KEY%>" value = "<%=ControllerConstants.USER_MANAGER %>"/>
			<input type = "hidden" name = "<%=ControllerConstants.METHOD_KEY%>" value = "<%=UserMgmtConstants.LOGIN_COMMAND%>"/>	
			<div style="width:90%; margin-left:auto; margin-right:auto; ">
				<div style="float:left; width:100%; margin-top:10px;">
					<div style="color:#555555;font-size:small; font-weight:bold; text-align:left">Username:</div> 
					<input class="regInput" style="margin-top:5px; width:100%;" type="text" name="username" />
				</div>
							
				<div style="float:left; width:100%; margin-top:10px;">
					<div style="color:#555555;font-size:small; font-weight:bold; text-align:left">Password:</div>
					<input class="regInput" style="margin-top: 5px; width:100%;" type="password" name="password" /><br/>
				</div>
				<input id="login" type="submit" value="login" style="width:25%; margin-top:15px; font-size:small; font-weight:bold; height:30px; float:left"/>
				<div style="clear:both"></div>
			</div>
		</form>

		<% 
		Map stateMap = (Map)session.getAttribute(ControllerConstants.STATE_MAP);
		if(stateMap!=null){
			String errorMessage = (String)stateMap.get(UserConstants.ERROR_MESSAGE);
			if (errorMessage!=null) {
				%>
				<p style="color:#FF0000; font-family:verdana"><%=errorMessage %></p>
				<%
			}
			String noticeMessage = (String)stateMap.get(UserConstants.NOTICE_MESSAGE);
			if (noticeMessage!=null) {
				%>
				<p style="color:#008000"><%=noticeMessage %></p>
				<%
			}
		
		}
		%>
		<div style="font-size:small;">
			<b style="color:#555555">New user?</b>
			<a href="signUp.jsp" >Sign-up now</a>
		</div>
		<hr style="color:#EDEDED"/>
		<div style="margin-bottom:5px;">
			<font size=1> <i>&#169; Cristian Codre. All rights reserved</i></font>
		</div>
	</div>

</div>